package inventoryServe.service.impl;


import inventoryServe.mapper.StoreManageMapper;
import inventoryServe.po.Inventory;
import inventoryServe.po.StoreManage;
import inventoryServe.service.StoreManageService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StoreManageServiceImpl  implements StoreManageService {
    // 注解注入
    @Autowired
    private StoreManageMapper storeManageMapper;

    @Override
    public Boolean addStoreManage(StoreManage storeManage) {
        return this.storeManageMapper.addStoreManage(storeManage) > 0;
    }

    @Override
    public List<StoreManage> allStoreManage(StoreManage storeManage) {

        return this.storeManageMapper.allStoreManage(storeManage);
    }

    @Override
    public StoreManage storeManageOfId(Integer id) {
        return this.storeManageMapper.storeManageOfId(id);
    }

    @Override
    public Boolean isCheck(StoreManage storeManage) {
        return this.storeManageMapper.isCheck(storeManage) > 0;
    }

    @Override
    public Boolean deleteStoreManage(Integer id) {
        return this.storeManageMapper.deleteStoreManage(id) > 0;
    }

    @Override
    public Boolean isInInventory(Inventory inventory) {
        return this.storeManageMapper.isInInventory(inventory) > 0;
    }

    @Override
    public Boolean addInventory(Inventory inventory) {
        return this.storeManageMapper.addInventory(inventory) > 0;
    }

    @Override
    public Boolean editAddInventory(Inventory inventory) {
        return this.storeManageMapper.editAddInventory(inventory) > 0;
    }

    @Override
    public int getInventoryNum(Integer storeId, Integer productId) {

        return this.storeManageMapper.getInventoryNum(storeId,productId);
    }

    @Override
    public Boolean editSubInventory(Inventory inventory) {
        return this.storeManageMapper.editSubInventory(inventory) > 0;
    }

    @Override
    public List<StoreManage> storeManageChart(StoreManage storeManage) {
        return this.storeManageMapper.storeManageChart(storeManage);
    }
}
